{$CLEO .cs}
0000:
animation_load "BOMBER"
model.Load(1654)  //dyn
model.Load(1252)  //C4
load_requested_models


const
     owner = $player_Actor 
     owner_press_key = 0 
end 
int Claymore_1
int Claymore_2

int Laser_left 
int Laser_right

int enemy
int audio 
int markered
if actor_defined owner
JF @no_owner_exitsed
IF NOT ACTOR.Driving(owner)
JF @no_owner_exitsed 
0792: disembark_instantly_actor owner
0A1A: actor owner perform_walk_animation "BOM_Plant" IFP "BOMBER" framedelta 9.0 loopA 0 lockX 0 lockY 0 lockF 0 400 ms // versionC

04C4: store_coords_to 21@ 22@ 23@ from_actor owner with_offset 0.0 0.5 -0.8 
Claymore_1=object.Init(1252,21@, 22@, 23@ )
25@=actor.Angle( owner )
25@ += 180.0
object.Angle( Claymore_1 ) = 25@

markered=marker.CreateAboveObject(Claymore_1)
marker.SetColor(markered,3)
marker.SetIconSize(markered,1)
018B: set_marker markered radar_mode 2

0382: set_object Claymore_1 collision_detection 0
//Start
0400: store_coords_to 20@ 21@ 22@ from_object Claymore_1 with_offset 0.0 0.0 0.6
/////////////////////////////////////////
wait 1000
0400: store_coords_to 23@ 24@ 25@ from_object Claymore_1 with_offset -3.0 4.0 0.6 
06B1: Laser_left = create_searchlight_at 20@ 21@ 22@  radius 0.1 target 23@ 24@ 25@  radius 0.12
0400: store_coords_to 23@ 24@ 25@ from_object Claymore_1 with_offset  3.0 4.0 0.6 
06B1: Laser_right = create_searchlight_at 20@ 21@ 22@  radius 0.1 target 23@ 24@ 25@  radius 0.12
0A02: set_searchlight Laser_left lights_through_obstacles 0
0A02: set_searchlight Laser_right lights_through_obstacles 0

//For the cube trigger
0400: store_coords_to 26@ 27@ 28@ from_object Claymore_1 with_offset  -2.5  -7.0 -1.0 
0400: store_coords_to 29@ 30@ 31@ from_object Claymore_1 with_offset  2.5  -7.0 2.0 

while true 
wait 0 
0AE1: enemy = random_char_near_point 0.0 0.0 0.0  in_radius 999999999.0 find_next 1 pass_deads 1
        if  actor_defined  enemy
        then
        089F: get_actor enemy pedtype_to 18@

            if AND 
           not 18@==8  
       //    06B3:   searchlight Laser_left active
       //     06B3:   searchlight Laser_right active
            object_defined Claymore_1 
            then
            
                 if  
                   
                 //06B7:   searchlight Laser_left spotted_actor enemy
                 //06B7:   searchlight Laser_right spotted_actor enemy
                // 0474:   actor enemy near_object_in_cube Claymore_1 radius 26@ 27@ 28@ sphere 0
                 05FC:   actor enemy in_cube_fll_corner_at  26@ 27@ 28@ fur_corner_at  29@ 30@ 31@ angle 25@ sphere 0

                 then
                       AUDIO =  Audiostream.Load3D("CLEO\[killstreaks]\claymorefuse.mp3")
                       AUDIOSTREAM.LinkToObject(AUDIO,Claymore_1)
                       AUDIOSTREAM.PerformAction(AUDIO,PLAY)
                     //Explode Claymore!!
                       06B2: destroy_searchlight Laser_left
                       06B2: destroy_searchlight Laser_right
                       WAIT 1000
                       0400: store_coords_to 20@ 21@ 22@ from_object Claymore_1 with_offset 0.0 0.0 0.0
                       Audiostream.Release(AUDIO)
                       AUDIO =  Audiostream.Load3D("CLEO\[killstreaks]\claymoreexplode.mp3")
                       AUDIOSTREAM.LinkToObject(AUDIO,Claymore_1)
                       AUDIOSTREAM.PerformAction(AUDIO,PLAY)
                    //   0565: create_soundless_explosion_at 20@ 21@ 22@ type 3
                        0948: create_explosion_at  20@ 21@ 22@    type 3 camera_shake 1.0

                       //0948: create_explosion_at 20@ 21@ 22@ type 3 camera_shake 1.0
                       0750: set_object Claymore_1 visibility 0
                       {
                      064B: 19@ = create_particle "explosion_tiny" a 20@ 21@ 22@ type 1
                      064C: make_particle 19@ visible
                      064F: remove_references_to_particle 19@    }

                    // show_styled_text "~r~Enemy Detected!" 1 5 
                     32@ = 0 
                    0400: store_coords_to 26@ 27@ 28@ from_object Claymore_1 with_offset  -3.0  -9.0 -1.2 
                    0400: store_coords_to 29@ 30@ 31@ from_object Claymore_1 with_offset  3.0  -9.0 3.0 
            //          explosion_tiny
          //explosion_large
                     //###########################
                     repeat
                     wait 0 
                     0AE1: enemy = random_char_near_point 0.0 0.0 0.0  in_radius 999999999.0 find_next 1 pass_deads 1
                     if  actor_defined  enemy
                     then
                        089F: get_actor enemy pedtype_to 18@

                         if and
                         not 18@==8 
                         05FC:   actor enemy in_cube_fll_corner_at  26@ 27@ 28@ fur_corner_at  29@ 30@ 31@ angle 25@ sphere 0
                         then
                             if actor.Driving(enemy)
                             then
                             0851: set_actor enemy decrease_health_by 5000 affect_armour 1
                             else
                             0851: set_actor enemy decrease_health_by 15000 affect_armour 1
                             end
                         end
                     end
                     until 32@ >= 1500
                     
                     WAIT 5000
                     Audiostream.Release(AUDIO)
                     object.Destroy(Claymore_1)
                     break
                 end
            end
        end
 
    
        if   
        $onmission == 0 
        then
            break
        end
end 

:no_owner_exitsed
//Cleanup the whole thing 
if and
06B3:   searchlight Laser_left active
06B3:   searchlight Laser_right active
then
   06B2: destroy_searchlight Laser_left
   06B2: destroy_searchlight Laser_right

end
if object_defined Claymore_1
then
   object.Destroy(Claymore_1)
end
marker.Disable(markered)
animation_release "BOMBER"
model.Destroy(1654)  //dyn
model.Destroy(1252)  //C4
0A93: terminate_this_custom_script